package org.example.httpserver;

import com.corundumstudio.socketio.SocketIOServer;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;


@SpringBootApplication
public class HttpServerApplication implements CommandLineRunner {

    private static final Logger log = LoggerFactory.getLogger(HttpServerApplication.class);
    private final SocketIOServer server;

    @Autowired
    public HttpServerApplication(SocketIOServer server) {
        this.server = server;
    }

    public static void main(String[] args) {
        SpringApplication.run(HttpServerApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        server.start();
    }
}
